//package com.art.museumbackend.config;
//
//import org.apache.catalina.connector.Connector;
//import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
//import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//public class WebServerConfig {
//
//    @Bean
//    public ServletWebServerFactory servletContainer() {
//        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
//
//        // 添加 HTTP 连接器
//        Connector httpConnector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
//        httpConnector.setPort(8080); // HTTP 端口
//        httpConnector.setRedirectPort(8099); // 将 HTTP 重定向到 HTTPS
//        tomcat.addAdditionalTomcatConnectors(httpConnector);
//
//        return tomcat;
//    }
//}